import {
  DashboardOutlined,
  SettingOutlined,
  OrderedListOutlined,
  BarcodeOutlined,
  AccountBookOutlined,
  ShopOutlined,
  ConsoleSqlOutlined,
} from '@ant-design/icons';
import Login from '../views/Login/login'
import Framelayout from '../layout/frame-layout'
import DashBoard from '../views/Dashborad'
import Setting from '../views/Setting'

import Commodity from '../views/Commodity'
import CommodifyList from '../views/Commodity/CommodifyList'

import Logistics from '../views/Logistics'
import Logs from '../views/Logs'
import Merchants from '../views/Merchants'

import Order from '../views/Order'
import OrderList from '../views/Order/OrderList'


const routers = [
  {
    path: '/login',
    exact: true,
    component: Login,
  },
  {
    path: '/',
    component: Framelayout,
    children: [
      {
        path: '/dashboard',
        component: DashBoard,
        meta: {
          title: '我的首页',
          icon: DashboardOutlined,
        },
      },
      {
        path: '/order',
        component: Order,
        meta: {
          title: '订单管理',
          icon: OrderedListOutlined,
        },
        children: [
          {
            path: '/order/orderlist',
            component: OrderList,
            meta: {
              title: '订单列表',
            },
          },
        ],
      },
      {
        path: '/commodity',
        component: Commodity,
        meta: {
          title: '商品管理',
          icon: AccountBookOutlined,
        },
        children: [
          {
            path: '/commodity/commoditylist',
            component: CommodifyList,
            meta: {
              title: '商品列表',
            },
          },
        ],
      },
      {
        path: '/logistics',
        component: Logistics,
        meta: {
          title: '物流管理',
          icon: BarcodeOutlined,
        },
      },
      {
        path: '/merchants',
        component: Merchants,
        meta: {
          title: '商家管理',
          icon: ShopOutlined,
        },
      },
      {
        path: '/setting',
        component: Setting,
        meta: {
          title: '权限配置',
          icon: SettingOutlined,
        },
      },
      {
        path: '/logs',
        component: Logs,
        meta: {
          title: '操作日志',
          icon: ConsoleSqlOutlined,
        },
      },
    ],
  },
]

export default routers
